#!/usr/bin/env python

import unittest
from selenium import webdriver


class Baidu(unittest.TestCase):
	def setUp(self):
		self.dr = webdriver.Firefox()
		self.base_url = 'http://www.baidu.com'
		self.dr.implicitly_wait(10)

	def test_sousuo(self):
		self.dr.get(self.base_url)
		self.dr.find_element_by_xpath('/html/body/div[3]/div[1]/div/div[1]/div/form/span[1]/input').send_keys('selenium')
		self.dr.find_element_by_id('su').click()
		

	def tearDown(self):
		self.dr.quit()



